//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS AppTest service.
///
/// AWS Mainframe Modernization Application Testing provides tools and resources for automated functional equivalence testing for your migration projects.
public struct AppTest: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the AppTest client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "AppTest",
            serviceIdentifier: "apptest",
            serviceProtocol: .restjson,
            apiVersion: "2022-12-06",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: AppTestErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "apptest-fips.us-east-1.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates a test case.
    @Sendable
    @inlinable
    public func createTestCase(_ input: CreateTestCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateTestCaseResponse {
        try await self.client.execute(
            operation: "CreateTestCase", 
            path: "/testcase", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a test case.
    ///
    /// Parameters:
    ///   - clientToken: The client token of the test case.
    ///   - description: The description of the test case.
    ///   - name: The name of the test case.
    ///   - steps: The steps in the test case.
    ///   - tags: The specified tags of the test case.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTestCase(
        clientToken: String? = CreateTestCaseRequest.idempotencyToken(),
        description: String? = nil,
        name: String,
        steps: [Step],
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateTestCaseResponse {
        let input = CreateTestCaseRequest(
            clientToken: clientToken, 
            description: description, 
            name: name, 
            steps: steps, 
            tags: tags
        )
        return try await self.createTestCase(input, logger: logger)
    }

    /// Creates a test configuration.
    @Sendable
    @inlinable
    public func createTestConfiguration(_ input: CreateTestConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateTestConfigurationResponse {
        try await self.client.execute(
            operation: "CreateTestConfiguration", 
            path: "/testconfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a test configuration.
    ///
    /// Parameters:
    ///   - clientToken: The client token of the test configuration.
    ///   - description: The description of the test configuration.
    ///   - name: The name of the test configuration.
    ///   - properties: The properties of the test configuration.
    ///   - resources: The defined resources of the test configuration.
    ///   - serviceSettings: The service settings of the test configuration.
    ///   - tags: The tags of the test configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTestConfiguration(
        clientToken: String? = CreateTestConfigurationRequest.idempotencyToken(),
        description: String? = nil,
        name: String,
        properties: [String: String]? = nil,
        resources: [Resource],
        serviceSettings: ServiceSettings? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateTestConfigurationResponse {
        let input = CreateTestConfigurationRequest(
            clientToken: clientToken, 
            description: description, 
            name: name, 
            properties: properties, 
            resources: resources, 
            serviceSettings: serviceSettings, 
            tags: tags
        )
        return try await self.createTestConfiguration(input, logger: logger)
    }

    /// Creates a test suite.
    @Sendable
    @inlinable
    public func createTestSuite(_ input: CreateTestSuiteRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateTestSuiteResponse {
        try await self.client.execute(
            operation: "CreateTestSuite", 
            path: "/testsuite", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a test suite.
    ///
    /// Parameters:
    ///   - afterSteps: The after steps of the test suite.
    ///   - beforeSteps: The before steps of the test suite.
    ///   - clientToken: The client token of the test suite.
    ///   - description: The description of the test suite.
    ///   - name: The name of the test suite.
    ///   - tags: The tags of the test suite.
    ///   - testCases: The test cases in the test suite.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTestSuite(
        afterSteps: [Step]? = nil,
        beforeSteps: [Step]? = nil,
        clientToken: String? = CreateTestSuiteRequest.idempotencyToken(),
        description: String? = nil,
        name: String,
        tags: [String: String]? = nil,
        testCases: TestCases,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateTestSuiteResponse {
        let input = CreateTestSuiteRequest(
            afterSteps: afterSteps, 
            beforeSteps: beforeSteps, 
            clientToken: clientToken, 
            description: description, 
            name: name, 
            tags: tags, 
            testCases: testCases
        )
        return try await self.createTestSuite(input, logger: logger)
    }

    /// Deletes a test case.
    @Sendable
    @inlinable
    public func deleteTestCase(_ input: DeleteTestCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteTestCaseResponse {
        try await self.client.execute(
            operation: "DeleteTestCase", 
            path: "/testcases/{testCaseId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a test case.
    ///
    /// Parameters:
    ///   - testCaseId: The test case ID of the test case.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTestCase(
        testCaseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteTestCaseResponse {
        let input = DeleteTestCaseRequest(
            testCaseId: testCaseId
        )
        return try await self.deleteTestCase(input, logger: logger)
    }

    /// Deletes a test configuration.
    @Sendable
    @inlinable
    public func deleteTestConfiguration(_ input: DeleteTestConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteTestConfigurationResponse {
        try await self.client.execute(
            operation: "DeleteTestConfiguration", 
            path: "/testconfigurations/{testConfigurationId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a test configuration.
    ///
    /// Parameters:
    ///   - testConfigurationId: The test ID of the test configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTestConfiguration(
        testConfigurationId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteTestConfigurationResponse {
        let input = DeleteTestConfigurationRequest(
            testConfigurationId: testConfigurationId
        )
        return try await self.deleteTestConfiguration(input, logger: logger)
    }

    /// Deletes a test run.
    @Sendable
    @inlinable
    public func deleteTestRun(_ input: DeleteTestRunRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteTestRunResponse {
        try await self.client.execute(
            operation: "DeleteTestRun", 
            path: "/testruns/{testRunId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a test run.
    ///
    /// Parameters:
    ///   - testRunId: The run ID of the test run.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTestRun(
        testRunId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteTestRunResponse {
        let input = DeleteTestRunRequest(
            testRunId: testRunId
        )
        return try await self.deleteTestRun(input, logger: logger)
    }

    /// Deletes a test suite.
    @Sendable
    @inlinable
    public func deleteTestSuite(_ input: DeleteTestSuiteRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteTestSuiteResponse {
        try await self.client.execute(
            operation: "DeleteTestSuite", 
            path: "/testsuites/{testSuiteId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a test suite.
    ///
    /// Parameters:
    ///   - testSuiteId: The test ID of the test suite.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTestSuite(
        testSuiteId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteTestSuiteResponse {
        let input = DeleteTestSuiteRequest(
            testSuiteId: testSuiteId
        )
        return try await self.deleteTestSuite(input, logger: logger)
    }

    /// Gets a test case.
    @Sendable
    @inlinable
    public func getTestCase(_ input: GetTestCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTestCaseResponse {
        try await self.client.execute(
            operation: "GetTestCase", 
            path: "/testcases/{testCaseId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a test case.
    ///
    /// Parameters:
    ///   - testCaseId: The request test ID of the test case.
    ///   - testCaseVersion: The test case version of the test case.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTestCase(
        testCaseId: String,
        testCaseVersion: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTestCaseResponse {
        let input = GetTestCaseRequest(
            testCaseId: testCaseId, 
            testCaseVersion: testCaseVersion
        )
        return try await self.getTestCase(input, logger: logger)
    }

    /// Gets a test configuration.
    @Sendable
    @inlinable
    public func getTestConfiguration(_ input: GetTestConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTestConfigurationResponse {
        try await self.client.execute(
            operation: "GetTestConfiguration", 
            path: "/testconfigurations/{testConfigurationId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a test configuration.
    ///
    /// Parameters:
    ///   - testConfigurationId: The request test configuration ID.
    ///   - testConfigurationVersion: The test configuration version.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTestConfiguration(
        testConfigurationId: String,
        testConfigurationVersion: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTestConfigurationResponse {
        let input = GetTestConfigurationRequest(
            testConfigurationId: testConfigurationId, 
            testConfigurationVersion: testConfigurationVersion
        )
        return try await self.getTestConfiguration(input, logger: logger)
    }

    /// Gets a test run step.
    @Sendable
    @inlinable
    public func getTestRunStep(_ input: GetTestRunStepRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTestRunStepResponse {
        try await self.client.execute(
            operation: "GetTestRunStep", 
            path: "/testruns/{testRunId}/steps/{stepName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a test run step.
    ///
    /// Parameters:
    ///   - stepName: The step name of the test run step.
    ///   - testCaseId: The test case ID of a test run step.
    ///   - testRunId: The test run ID of the test run step.
    ///   - testSuiteId: The test suite ID of a test run step.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTestRunStep(
        stepName: String,
        testCaseId: String? = nil,
        testRunId: String,
        testSuiteId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTestRunStepResponse {
        let input = GetTestRunStepRequest(
            stepName: stepName, 
            testCaseId: testCaseId, 
            testRunId: testRunId, 
            testSuiteId: testSuiteId
        )
        return try await self.getTestRunStep(input, logger: logger)
    }

    /// Gets a test suite.
    @Sendable
    @inlinable
    public func getTestSuite(_ input: GetTestSuiteRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTestSuiteResponse {
        try await self.client.execute(
            operation: "GetTestSuite", 
            path: "/testsuites/{testSuiteId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a test suite.
    ///
    /// Parameters:
    ///   - testSuiteId: The ID of the test suite.
    ///   - testSuiteVersion: The version of the test suite.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTestSuite(
        testSuiteId: String,
        testSuiteVersion: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTestSuiteResponse {
        let input = GetTestSuiteRequest(
            testSuiteId: testSuiteId, 
            testSuiteVersion: testSuiteVersion
        )
        return try await self.getTestSuite(input, logger: logger)
    }

    /// Lists tags for a resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists tags for a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Lists test cases.
    @Sendable
    @inlinable
    public func listTestCases(_ input: ListTestCasesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTestCasesResponse {
        try await self.client.execute(
            operation: "ListTestCases", 
            path: "/testcases", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists test cases.
    ///
    /// Parameters:
    ///   - maxResults: The maximum results of the test case.
    ///   - nextToken: The next token of the test cases.
    ///   - testCaseIds: The IDs of the test cases.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTestCases(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        testCaseIds: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTestCasesResponse {
        let input = ListTestCasesRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            testCaseIds: testCaseIds
        )
        return try await self.listTestCases(input, logger: logger)
    }

    /// Lists test configurations.
    @Sendable
    @inlinable
    public func listTestConfigurations(_ input: ListTestConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTestConfigurationsResponse {
        try await self.client.execute(
            operation: "ListTestConfigurations", 
            path: "/testconfigurations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists test configurations.
    ///
    /// Parameters:
    ///   - maxResults: The maximum results of the test configuration.
    ///   - nextToken: The next token for the test configurations.
    ///   - testConfigurationIds: The configuration IDs of the test configurations.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTestConfigurations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        testConfigurationIds: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTestConfigurationsResponse {
        let input = ListTestConfigurationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            testConfigurationIds: testConfigurationIds
        )
        return try await self.listTestConfigurations(input, logger: logger)
    }

    /// Lists test run steps.
    @Sendable
    @inlinable
    public func listTestRunSteps(_ input: ListTestRunStepsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTestRunStepsResponse {
        try await self.client.execute(
            operation: "ListTestRunSteps", 
            path: "/testruns/{testRunId}/steps", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists test run steps.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of test run steps to return in one page of results.
    ///   - nextToken: The token from a previous step to retrieve the next page of results.
    ///   - testCaseId: The test case ID of the test run steps.
    ///   - testRunId: The test run ID of the test run steps.
    ///   - testSuiteId: The test suite ID of the test run steps.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTestRunSteps(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        testCaseId: String? = nil,
        testRunId: String,
        testSuiteId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTestRunStepsResponse {
        let input = ListTestRunStepsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            testCaseId: testCaseId, 
            testRunId: testRunId, 
            testSuiteId: testSuiteId
        )
        return try await self.listTestRunSteps(input, logger: logger)
    }

    /// Lists test run test cases.
    @Sendable
    @inlinable
    public func listTestRunTestCases(_ input: ListTestRunTestCasesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTestRunTestCasesResponse {
        try await self.client.execute(
            operation: "ListTestRunTestCases", 
            path: "/testruns/{testRunId}/testcases", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists test run test cases.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of test run test cases to return in one page of results.
    ///   - nextToken: The token from a previous request to retrieve the next page of results.
    ///   - testRunId: The test run ID of the test cases.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTestRunTestCases(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        testRunId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTestRunTestCasesResponse {
        let input = ListTestRunTestCasesRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            testRunId: testRunId
        )
        return try await self.listTestRunTestCases(input, logger: logger)
    }

    /// Lists test runs.
    @Sendable
    @inlinable
    public func listTestRuns(_ input: ListTestRunsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTestRunsResponse {
        try await self.client.execute(
            operation: "ListTestRuns", 
            path: "/testruns", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists test runs.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of test runs to return in one page of results.
    ///   - nextToken: The token from the previous request to retrieve the next page of test run results.
    ///   - testRunIds: The test run IDs of the test runs.
    ///   - testSuiteId: The test suite ID of the test runs.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTestRuns(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        testRunIds: [String]? = nil,
        testSuiteId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTestRunsResponse {
        let input = ListTestRunsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            testRunIds: testRunIds, 
            testSuiteId: testSuiteId
        )
        return try await self.listTestRuns(input, logger: logger)
    }

    /// Lists test suites.
    @Sendable
    @inlinable
    public func listTestSuites(_ input: ListTestSuitesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTestSuitesResponse {
        try await self.client.execute(
            operation: "ListTestSuites", 
            path: "/testsuites", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists test suites.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of test suites to return in one page of results.
    ///   - nextToken: The token from a previous request to retrieve the next page of results.
    ///   - testSuiteIds: The suite ID of the test suites.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTestSuites(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        testSuiteIds: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTestSuitesResponse {
        let input = ListTestSuitesRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            testSuiteIds: testSuiteIds
        )
        return try await self.listTestSuites(input, logger: logger)
    }

    /// Starts a test run.
    @Sendable
    @inlinable
    public func startTestRun(_ input: StartTestRunRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartTestRunResponse {
        try await self.client.execute(
            operation: "StartTestRun", 
            path: "/testrun", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts a test run.
    ///
    /// Parameters:
    ///   - clientToken: The client token of the test run.
    ///   - tags: The tags of the test run.
    ///   - testConfigurationId: The configuration ID of the test run.
    ///   - testSuiteId: The test suite ID of the test run.
    ///   - logger: Logger use during operation
    @inlinable
    public func startTestRun(
        clientToken: String? = StartTestRunRequest.idempotencyToken(),
        tags: [String: String]? = nil,
        testConfigurationId: String? = nil,
        testSuiteId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartTestRunResponse {
        let input = StartTestRunRequest(
            clientToken: clientToken, 
            tags: tags, 
            testConfigurationId: testConfigurationId, 
            testSuiteId: testSuiteId
        )
        return try await self.startTestRun(input, logger: logger)
    }

    /// Specifies tags of a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Specifies tags of a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the tag resource.
    ///   - tags: The tags of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Untags a resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Untags a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tagKeys: The tag keys of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates a test case.
    @Sendable
    @inlinable
    public func updateTestCase(_ input: UpdateTestCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateTestCaseResponse {
        try await self.client.execute(
            operation: "UpdateTestCase", 
            path: "/testcases/{testCaseId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a test case.
    ///
    /// Parameters:
    ///   - description: The description of the test case.
    ///   - steps: The steps of the test case.
    ///   - testCaseId: The test case ID of the test case.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTestCase(
        description: String? = nil,
        steps: [Step]? = nil,
        testCaseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateTestCaseResponse {
        let input = UpdateTestCaseRequest(
            description: description, 
            steps: steps, 
            testCaseId: testCaseId
        )
        return try await self.updateTestCase(input, logger: logger)
    }

    /// Updates a test configuration.
    @Sendable
    @inlinable
    public func updateTestConfiguration(_ input: UpdateTestConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateTestConfigurationResponse {
        try await self.client.execute(
            operation: "UpdateTestConfiguration", 
            path: "/testconfigurations/{testConfigurationId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a test configuration.
    ///
    /// Parameters:
    ///   - description: The description of the test configuration.
    ///   - properties: The properties of the test configuration.
    ///   - resources: The resources of the test configuration.
    ///   - serviceSettings: The service settings of the test configuration.
    ///   - testConfigurationId: The test configuration ID of the test configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTestConfiguration(
        description: String? = nil,
        properties: [String: String]? = nil,
        resources: [Resource]? = nil,
        serviceSettings: ServiceSettings? = nil,
        testConfigurationId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateTestConfigurationResponse {
        let input = UpdateTestConfigurationRequest(
            description: description, 
            properties: properties, 
            resources: resources, 
            serviceSettings: serviceSettings, 
            testConfigurationId: testConfigurationId
        )
        return try await self.updateTestConfiguration(input, logger: logger)
    }

    /// Updates a test suite.
    @Sendable
    @inlinable
    public func updateTestSuite(_ input: UpdateTestSuiteRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateTestSuiteResponse {
        try await self.client.execute(
            operation: "UpdateTestSuite", 
            path: "/testsuites/{testSuiteId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a test suite.
    ///
    /// Parameters:
    ///   - afterSteps: The after steps of the test suite.
    ///   - beforeSteps: The before steps for the test suite.
    ///   - description: The description of the test suite.
    ///   - testCases: The test cases in the test suite.
    ///   - testSuiteId: The test suite ID of the test suite.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTestSuite(
        afterSteps: [Step]? = nil,
        beforeSteps: [Step]? = nil,
        description: String? = nil,
        testCases: TestCases? = nil,
        testSuiteId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateTestSuiteResponse {
        let input = UpdateTestSuiteRequest(
            afterSteps: afterSteps, 
            beforeSteps: beforeSteps, 
            description: description, 
            testCases: testCases, 
            testSuiteId: testSuiteId
        )
        return try await self.updateTestSuite(input, logger: logger)
    }
}

extension AppTest {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: AppTest, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AppTest {
    /// Return PaginatorSequence for operation ``listTestCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestCasesPaginator(
        _ input: ListTestCasesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTestCasesRequest, ListTestCasesResponse> {
        return .init(
            input: input,
            command: self.listTestCases,
            inputKey: \ListTestCasesRequest.nextToken,
            outputKey: \ListTestCasesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTestCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum results of the test case.
    ///   - testCaseIds: The IDs of the test cases.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestCasesPaginator(
        maxResults: Int? = nil,
        testCaseIds: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTestCasesRequest, ListTestCasesResponse> {
        let input = ListTestCasesRequest(
            maxResults: maxResults, 
            testCaseIds: testCaseIds
        )
        return self.listTestCasesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTestConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestConfigurationsPaginator(
        _ input: ListTestConfigurationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTestConfigurationsRequest, ListTestConfigurationsResponse> {
        return .init(
            input: input,
            command: self.listTestConfigurations,
            inputKey: \ListTestConfigurationsRequest.nextToken,
            outputKey: \ListTestConfigurationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTestConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum results of the test configuration.
    ///   - testConfigurationIds: The configuration IDs of the test configurations.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestConfigurationsPaginator(
        maxResults: Int? = nil,
        testConfigurationIds: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTestConfigurationsRequest, ListTestConfigurationsResponse> {
        let input = ListTestConfigurationsRequest(
            maxResults: maxResults, 
            testConfigurationIds: testConfigurationIds
        )
        return self.listTestConfigurationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTestRunSteps(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestRunStepsPaginator(
        _ input: ListTestRunStepsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTestRunStepsRequest, ListTestRunStepsResponse> {
        return .init(
            input: input,
            command: self.listTestRunSteps,
            inputKey: \ListTestRunStepsRequest.nextToken,
            outputKey: \ListTestRunStepsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTestRunSteps(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of test run steps to return in one page of results.
    ///   - testCaseId: The test case ID of the test run steps.
    ///   - testRunId: The test run ID of the test run steps.
    ///   - testSuiteId: The test suite ID of the test run steps.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestRunStepsPaginator(
        maxResults: Int? = nil,
        testCaseId: String? = nil,
        testRunId: String,
        testSuiteId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTestRunStepsRequest, ListTestRunStepsResponse> {
        let input = ListTestRunStepsRequest(
            maxResults: maxResults, 
            testCaseId: testCaseId, 
            testRunId: testRunId, 
            testSuiteId: testSuiteId
        )
        return self.listTestRunStepsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTestRunTestCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestRunTestCasesPaginator(
        _ input: ListTestRunTestCasesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTestRunTestCasesRequest, ListTestRunTestCasesResponse> {
        return .init(
            input: input,
            command: self.listTestRunTestCases,
            inputKey: \ListTestRunTestCasesRequest.nextToken,
            outputKey: \ListTestRunTestCasesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTestRunTestCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of test run test cases to return in one page of results.
    ///   - testRunId: The test run ID of the test cases.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestRunTestCasesPaginator(
        maxResults: Int? = nil,
        testRunId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTestRunTestCasesRequest, ListTestRunTestCasesResponse> {
        let input = ListTestRunTestCasesRequest(
            maxResults: maxResults, 
            testRunId: testRunId
        )
        return self.listTestRunTestCasesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTestRuns(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestRunsPaginator(
        _ input: ListTestRunsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTestRunsRequest, ListTestRunsResponse> {
        return .init(
            input: input,
            command: self.listTestRuns,
            inputKey: \ListTestRunsRequest.nextToken,
            outputKey: \ListTestRunsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTestRuns(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of test runs to return in one page of results.
    ///   - testRunIds: The test run IDs of the test runs.
    ///   - testSuiteId: The test suite ID of the test runs.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestRunsPaginator(
        maxResults: Int? = nil,
        testRunIds: [String]? = nil,
        testSuiteId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTestRunsRequest, ListTestRunsResponse> {
        let input = ListTestRunsRequest(
            maxResults: maxResults, 
            testRunIds: testRunIds, 
            testSuiteId: testSuiteId
        )
        return self.listTestRunsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTestSuites(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestSuitesPaginator(
        _ input: ListTestSuitesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTestSuitesRequest, ListTestSuitesResponse> {
        return .init(
            input: input,
            command: self.listTestSuites,
            inputKey: \ListTestSuitesRequest.nextToken,
            outputKey: \ListTestSuitesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTestSuites(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of test suites to return in one page of results.
    ///   - testSuiteIds: The suite ID of the test suites.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTestSuitesPaginator(
        maxResults: Int? = nil,
        testSuiteIds: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTestSuitesRequest, ListTestSuitesResponse> {
        let input = ListTestSuitesRequest(
            maxResults: maxResults, 
            testSuiteIds: testSuiteIds
        )
        return self.listTestSuitesPaginator(input, logger: logger)
    }
}

extension AppTest.ListTestCasesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppTest.ListTestCasesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            testCaseIds: self.testCaseIds
        )
    }
}

extension AppTest.ListTestConfigurationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppTest.ListTestConfigurationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            testConfigurationIds: self.testConfigurationIds
        )
    }
}

extension AppTest.ListTestRunStepsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppTest.ListTestRunStepsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            testCaseId: self.testCaseId,
            testRunId: self.testRunId,
            testSuiteId: self.testSuiteId
        )
    }
}

extension AppTest.ListTestRunTestCasesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppTest.ListTestRunTestCasesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            testRunId: self.testRunId
        )
    }
}

extension AppTest.ListTestRunsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppTest.ListTestRunsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            testRunIds: self.testRunIds,
            testSuiteId: self.testSuiteId
        )
    }
}

extension AppTest.ListTestSuitesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppTest.ListTestSuitesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            testSuiteIds: self.testSuiteIds
        )
    }
}
